/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ac.za.cput.kleintjes.question3.lsp.violates.testing;

import ac.za.cput.kleintjes.question3.lsp.violates.conf.BirdConfig;
import ac.za.cput.kleintjes.question3.lsp.violates.model.Bird;
import ac.za.cput.kleintjes.question3.lsp.violates.model.Eagle;
import ac.za.cput.kleintjes.question3.lsp.violates.model.Ostrach;
import ac.za.cput.kleintjes.question3.lsp.violates.services.IBird;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 *
 * @author Hughan.Kleintjes.hughanK@gmail.com
 */
public class IBirdJUnitTestv {
    private static ApplicationContext ctx;
    private static IBird bird;
    
    public IBirdJUnitTestv() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
        ctx = new AnnotationConfigApplicationContext(BirdConfig.class);
        bird = (IBird)ctx.getBean("bird");
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    /**
     * Test of flyDistance method, of class IBird.
     */
    @Test (expected=UnsupportedOperationException.class)
    public void testFlyDistance() {
        System.out.println("flyDistance");
        Bird eagle = new Eagle();
        Bird ostrach = new Ostrach();
        
        eagle.setFlyDistance(10);
        eagle.setFlySpeed(10);
        ostrach.setDistance(12);
        
        
        bird.flyDistance(eagle, ostrach);
    }

}
